import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
//维修项目新增列表
export const getLabourList = params =>
  axios.get(`${SERVER.CLAIMDEALER}/rPPreAuth/preAuthLabourPage`, {
    params
  });
//配件换上件新增列表
export const getShangJianListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rpPart/getListByPage`, params);
//配件换下件新增列表
export const getXiaJianListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rpPart/getListByPage`, params);
//附加项目新增列表
export const getFuJiaXiangMuListByPage = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getAddList`, { params });
//维修工单号列表
export const getWeiXiuGongDanListByPage = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getRoList`, { params });
//主损件选择
export const zhuSunJianSelect = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getPartList`, { params });
//故障现象列表
export const getGuZhangXianXiangListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPFaultAppear/getListByPage`, params);
//故障原因列表
export const getGuZhangYuanYinListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPFaultReason/getListByPage`, params);
//自费工单选择
export const getZiFeiGongDanListByPage = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getSelfList`, { params });
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMDEALER}/rPPtType/getListForExport`, params, {
  responseType: 'blob'
});
//预授权状态下拉
export const getPartType = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getBaseDataByType`, { params });
//预授权新增
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/saveOne`, params);
//编辑的保存
export const editSave = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/updateByPtId`,  params );
//预授权检索
export const getListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/getListByPage`, params);

//车型取得
export const getModelList = params =>
  axios.get(`${SERVER.CLAIMDEALER}/const/getModelList`, {
    params
  });
//修改回显
export const quyRpPreAuth = (id, params) => axios.get(`${SERVER.CLAIMDEALER}/rPPreAuth/selectById/${id}`, { params });
//索赔类型取得
export const cmsClaimTypeStr = params =>
  axios.get(`${SERVER.CLAIMDEALER}/const/getBaseDataByType`, {
    params
  });
//供应商下拉框
export const getSupplierList = params => axios.get(`${SERVER.CLAIMDEALER}/const/getSupplierList`, { params });
//索赔类型取得
export const getclaimType = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getBaseDataByType`, { params });
//救援单取得
export const getjiuYuanList = (params) => axios.get(`${SERVER.CLAIMDEALER}/const/getHelpList`, { params });
//作废（单条删除）
export const zuofeiFun = data => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/updateEnableByIds`, null, { params: data });
//审核记录
export const getAuditRecord = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuthLog/getListByPage`, params);
//维修历史
export const getMaintenanceHistory = params => axios.get(`${SERVER.CLAIMDEALER}/const/getRoLogList`,  { params });
//变更记录
export const getChangeRecord = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuthChange/getListByPage`, params);
//索赔历史
export const getClaimHistory = params => axios.post(`${SERVER.CLAIMDEALER}/rPCmsClaim/getListByPage`, params);
//获取工单部分信息（通过工单号取外部接口数据）
export const quyRomessage = params => axios.get(`${SERVER.CLAIMDEALER}/const/getRoById`,    { params } );
//主页面的单条删除
export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/updateStatusById/${id}`,{params} );
//判断是否是特殊车  弃用
//修改回显
export const isSpecialCar = (vin, params) => axios.get(`${SERVER.CLAIMDEALER}/rPPreAuth/isSpecialCar/${vin}`, { params });

export const getPreAuthPartPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/preAuthPartPage`, params);
// 工单 附加项目
export const queryRoAddItemForClaim = params => axios.get(`${SERVER.CLAIMDEALER}/rPPreAuth/preAuthAddItemPage`, { params });

export const translateByVinAndModelCode = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/translateByVinAndModelCode`, params);

//换上件配件算数
export const getAuthPart = params => axios.post(`${SERVER.CLAIMDEALER}/rPPreAuth/getPartListDetail`, params);
//查询附加项目附件
export const queryByIdAndCode = params => axios.post(`${SERVER.CLAIMDEALER}/preAuthAppendFile/queryByIdAndNo`, params);
//修改附加项目附件
export const saveOne = params => axios.post(`${SERVER.CLAIMDEALER}/preAuthAppendFile/saveOne`, params);
//查询车主车辆信息
export const getVehicleByVin = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/order/repair/getVehicleByVin`,  params);
// 获取备件保修期 保修里程
export const getPartWarranty = (params) => axios.get(`${SERVER.CLAIMDEALER}/rPPreAuth/getPartWarranty`, {params});
